//
//  BKLang.m
//  AFNetworking
//
//  Created by baboy on 2019/2/19.
//

#import <Foundation/Foundation.h>
#import "BKLang.h"

@implementation BKLang

+ (NSString*)currentLang{
    
    NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
    NSArray * langs = [defaults objectForKey:@"AppleLanguages"];
    NSString *s = [langs objectAtIndex:0];
    NSRange r = [s rangeOfString:@"-" options:NSCaseInsensitiveSearch];
    NSString *lang = s;
    if (r.length>0) {
        lang = [s substringToIndex:r.location];
    }
    return lang;
}
+ (NSString *)localizedString:(NSString *)key{
    NSString *s = NSLocalizedString(key, nil);
    return s;
}
@end
